<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>药敏结果录入</title>
    <meta http-equiv="keywords" content="enter,your,keywords,here" />
    <meta http-equiv="description" content="A short description of this page." />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <#include "/template/head.html">
    <script type="text/javascript"> 
    function adjustXB(){
      var tch = $("#xb_tch").val();
      var pnb = $("#xb_pnb").val()
      if(tch=='+' && pnb=='+'){
        $("#xb").val("非结核分枝杆菌");
      } else if(tch=='+' && pnb=='-'){
      	$("#xb").val("人型结核分枝杆菌");
      } else if(tch=='-' && pnb=='-'){
      	$("#xb").val("牛型结核分枝杆菌");
      }
    }

    var savedDDLID
    function adjustResult(){
      var $noResults = $("select[name='noResults']");
      var $allInput = $("#ymjgForm :input[tag!='excluded']")
      if($noResults.val()!=null && $noResults.val()!="" && $noResults.val()!="0"){
        if(confirm("警告：将会清除上面所有填写内容，是否继续？"))
        	$allInput.val("").attr('disabled', 'disabled');
        else
          $noResults.val(savedDDLID)
      }else {
    	  $allInput.removeAttr('disabled');
      }
      savedDDLID=$noResults.val();
    }
    function checkKicid(){
      var $kicid = $("#kicid");
      var val = $kicid.val();
      if (val!="" && !isNaN(val)) {
    	  if(val.length<8) {
 	        while (val.length<8) {
 	            val = '0' + val;
 	        }
 	       $kicid.val(val);
 	      }
        return true;
      } else {
        $(".error").html("<img src='${basePath}img/unchecked.gif'/>KICID号输入不正确！")
      	return false;
      }
    }
    </script> 
  </head>
  <body>
    <table class="cmxform" cellspacing="1">
      <caption>药&nbsp;&nbsp;敏&nbsp;&nbsp;结&nbsp;&nbsp;果&nbsp;&nbsp;录&nbsp;&nbsp;入</caption>
      <form id="searchForm" action="${basePath}ymjg/add.do" method="post" onsubmit="return checkKicid()">
      <tr>
        <th width="12%">KICID号：</th>
        <td colspan="3">
          <input id="kicid" name="kicid" value="${kicid}" maxlength="8"/>
          <#if tips??>
            <span for="kicid" class="error"><img src="${basePath}img/unchecked.gif"/>${tips}</span>
          <#else>
            <label for="kicid" class="error">预警8位条码号</label>
          </#if>
          <button type="submit" class="none" />
        </td>
      </tr>
      </form>
      <tr>
        <td colspan="4">病人基本信息</td>
      </tr>
      <#if baseInfo??>
      <tr>
        <th width="12%">病人登记号：</th>
        <td width="38%">${baseInfo.djhm}</td>
        <th width="12%">报告单位：</th>
        <td width="38%">${baseInfo.djdw.dwmc}</td>
      </tr>
      <tr>
        <th>病人姓名：</th>
        <td>${baseInfo.brxm}</td>
        <th>登记日期：</th>
        <td >${baseInfo.djrq}</td>
      </tr>
      <tr>
        <th>性别：</th>
        <td>
          <#if baseInfo.brxb?? && baseInfo.brxb==1>男<#else>女</#if>
        </td>
        <th>出生日期：</th>
        <td>${baseInfo.csrq}</td>
      </tr>
      <tr>
        <td colspan="4">药敏结果录入（比例法）<br />
          <span style="color:blue">本表填写说明：日期格式 yyyy-MM-dd；</span>
        </td>
      </tr>
      <tr>
      	<td colspan="4">
      	<form id="ymjgForm" action="${basePath}ymjg/save.do" method="post">
	      	<table id="ymjgTb" class="cmxform" cellspacing="1">
			      <tr>
			        <th>一、MIRU分型结果：</th>
			        <td colspan="3"><input name="miru"/></td>
			      </tr>
			      <tr>
			        <th>二、VNTR分型结果：</th>
			        <td colspan="3"><input name="vntr"/></td>
			      </tr>
			      <tr>
			        <th>三、RD105分型结果：</th>
			        <td colspan="3"><input name="rd105"/></td>
			      </tr>
			      <tr>
			        <th>四、药敏结果：</th>
			        <td colspan="3">
			          <table class="inform" cellspacing="1">
			            <tr>
			              <th width="20%">INH（异烟肼）：</th>
			              <td width="80%">
			                <select name="ym_inh">
			                  <option></option>
			                  <option>R</option>
			                  <option selected="selected">S</option>
			                </select>0.2
			              </td>
			            </tr>
			            <tr>
			              <th>RFP（利福平）：</th>
			              <td colspan="3">
			                <select name="ym_rfp">
			                  <option></option>
			                  <option>R</option>
			                  <option selected="selected">S</option>
			                </select>40.0
			              </td>
			            </tr>
			            <tr>
			              <th>EMB（乙胺丁醇）：</th>
			              <td colspan="3">
			                <select name="ym_emb">
			                  <option></option>
			                  <option>R</option>
			                  <option selected="selected">S</option>
			                </select>2.0
			              </td>
			            </tr>
			            <tr>
			              <th>SM（链霉素）：</th>
			              <td colspan="3">
			                <select name="ym_sm">
			                  <option></option>
			                  <option>R</option>
			                  <option selected="selected">S</option>
			                </select>4.0
			              </td>
			            </tr>
			            <tr>
			              <th>PAS（对氨水杨酸）：</th>
			              <td colspan="3">
			                <select name="ym_pas">
			                  <option></option>
			                  <option>R</option>
			                  <option>S</option>
			                </select>1.0
			              </td>
			            </tr>
			            <tr>
			              <th>KM（卡那霉素）：</th>
			              <td colspan="3">
			                <select name="ym_km">
			                  <option></option>
			                  <option>R</option>
			                  <option>S</option>
			                </select>3.0
			              </td>
			            </tr>
			            <tr>
			              <th>OFLX（氧氟沙星）：</th>
			              <td colspan="3">
			                <select name="ym_oflx">
			                  <option></option>
			                  <option>R</option>
			                  <option>S</option>
			                </select>30.0
			              </td>
			            </tr>
			            <tr>
			              <th>CPM（卷曲霉素）：</th>
			              <td colspan="3">
			                <select name="ym_cpm">
			                  <option></option>
			                  <option>R</option>
			                  <option>S</option>
			                </select>40.0
			              </td>
			            </tr>
			            <tr>
			              <th>ETO/PTO（乙硫丙硫异烟肼）：</th>
			              <td colspan="3">
			                <select name="ym_etopto">
			                  <option></option>
			                  <option>R</option>
			                  <option>S</option>
			                </select>40.0
			              </td>
			            </tr>
			          </table>
			        </td>
			      </tr>
			      <tr>
			        <th>五、菌型鉴定结果：</th>
			        <td colspan="3">
			          <table class="inform" cellspacing="1">
			            <tr>
			              <th width="20%">1、HPLC结果：</th>
			              <td width="80%"><input name="hplc_class" class="w80"/>&nbsp;&nbsp;<input name="hplc_jm" class="w80"/></td>
			            </tr>
			            <tr>
			              <th>2、型别鉴定：</th>
			              <td colspan="3">
			                <label for="xb_tch">TCH</label>
			                <select id="xb_tch" name="xb_tch" onchange="adjustXB();">
			                  <option></option>
			                  <option value="+" selected="selected">+</option>
			                  <option value="-">-</option>
			                </select>
			                <label for="xb_pnb">PNB</label>
			                <select id="xb_pnb" name="xb_pnb" onchange="adjustXB();">
			                  <option></option>
			                  <option value="+">+</option>
			                  <option value="-" selected="selected">-</option>
			                </select>
			                <label for="xb">型别</label>
			                <input id="xb" name="xb" value="人型结核分枝杆菌"/>
			              </td>
			            </tr>
			            <tr>
			              <th>3、基因测序（16srRNA）</th>
			              <td colspan="3"><input name="srrna"/></td>
			            </tr>
			          </table>
			        </td>
			      </tr>
			      <tr style="color: red">
			        <th>六、未获得试验结果：</th>
			        <td colspan="3">
			        	<select name="noResults" onchange="adjustResult();" tag="excluded">
			        		<option value="0"></option>
			        		<#list constants.noResults as item>
			              <option value="${item_index+1}">${item}</option>
			            </#list>
			        	</select>
			        </td>
			      </tr>
			      <tfoot>
			        <tr>
			          <td colspan="4">
			            <input type="hidden" name="kicid" value="${baseInfo.kicid}" tag="excluded"/>
			            <button type="submit" class="save" tag="excluded"/>
			          </td>
			        </tr>
			      </tfoot>
			      </#if>
	      	</table>
	      	</form>
      	</td>
      </tr>
    </table>
    <#include "/template/common/alert_message.html"/>
  </body>
</html>
